#pragma once
#include <functional>

using cb_t = std::function<void(int, const std::string &, const uint16_t &)>;
class Task
{
public:
    Task()
    {
    }
    Task(int sock, const std::string &ip, const uint16_t &port, cb_t func)
        : sock_(sock), ip_(ip), port_(port), func_(func)
    {
    }
    void operator()()
    {
        func_(sock_, ip_, port_);
    }
    ~Task()
    {
    }

private:
    int sock_;
    cb_t func_;
    std::string ip_;
    uint16_t port_;
};